package com.example.controller;

import com.example.entity.ElevatorArchives;
import com.example.ext.entity.ExtElevatorAppraisal;
import com.example.service.ElevatorArchivesService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * Created by youkun on 2017/10/20.
 */
@RestController
public class ElevatorArchivesController {

    @Autowired
    private ElevatorArchivesService elevatorArchivesService;

    @ApiOperation(value = "查询电梯一梯一档",notes = "查询电梯一梯一档")
    @RequestMapping(value="api/elevatorApprais/{id}",method = RequestMethod.POST)
    Map<String,Object> queryById(@PathVariable String id){

        return elevatorArchivesService.queryById(id);
    }

    @ApiOperation(value = "新增电梯一梯一档",notes = "新增电梯一梯一档")
    @RequestMapping(value="api/elevatorApprais/add",method = RequestMethod.POST)
    Map<String,Object> add(@RequestBody  ElevatorArchives elevatorArchives){

        return elevatorArchivesService.add(elevatorArchives);
    }

    @ApiOperation(value = "修改电梯一梯一档",notes = "修改电梯一梯一档")
    @RequestMapping(value="api/elevatorApprais/update",method = RequestMethod.POST)
    Map<String,Object> update(@RequestBody  ElevatorArchives elevatorArchives){

        return elevatorArchivesService.update(elevatorArchives);
    }
}
